Sponsored by Deepsite.site

CostAffective-MCP

Created By
Yash Gajjar2 days ago
Intelligent repository context for AI coding assistants. Provides code search, symbol lookup, call graphs, and reference tracking via MCP. Uniquely designed to minimize prompt-cache costs in long sessions stash/recall/remember tools keep large content out of context until needed, and a token-budgeted repository summary avoids unbounded prompt bloat. Works with any MCP client (Claude, Codex, Cursor, opencode, etc..). Go, CGO, tree-sitter-backed.
Overview

costaffective-mcp

Coding agents that explore less, remember more, and carry less context.

MCP:

github.com/okyashgajjar/costaffective-mcp

CostAffective is a local MCP server that makes AI coding agents behave like experienced engineers. Instead of re-reading whole files every turn, dumping build logs into context, and re-discovering symbols they already found, agents get fast, token-budgeted access to your repository — so they stop carrying everything around forever.

Why

In long sessions the dominant cost is not the model's output — it's the prompt cache re-reading and re-writing everything resident in the context window every turn. A real measured example: a single API call billed at $2.95, of which $2.84 was a 5-minute cache write of ~455k tokens of resident context. The answer was under 4,000 tokens.

CostAffective fixes this by keeping tokens out of the window in the first place.

Tools (11 MCP tools)

Retrieval

  • search_code — semantic repository search by natural language question
  • find_symbol — locate where a symbol is defined
  • read_symbol — return a symbol's full implementation body by name
  • find_references — every usage of a symbol, precomputed
  • find_callers — which functions call a given function

Context control

  • remember — persist a durable fact once instead of repeating it inline
  • stash_context — park a large blob (file, log, output) out of context behind a tiny handle
  • recall — pull back only the slice matching a query, within a token budget

Maintenance

  • get_repository_summary — token-budgeted repo overview, drillable by module
  • index_repository — manual re-index trigger

Session awareness

  • costaffective-session skill — 275-token guidance auto-delivered via MCP instructions field, teaching agents to stash, remember, and retrieve instead of pasting inline

Architecture

AI Client (MCP Host) → stdio transport → costaffective serve
  ├── Tree-sitter parser → Symbol / Reference / Call Graph indexes
  ├── Per-repo stash (large blobs out of context)
  ├── Per-repo durable facts (remember/recall)
  └── Token-budgeted compression on every tool output

All per-repo state lives under .mycli-fts/ in the repo root. Index is local SQLite. No cloud, no API keys.

Benchmarks

Small repo: tokens consumed dropped 81.7% (299K → 55K), 2.2x faster, 70% fewer tool calls. Large repo (Continue OSS): tokens down 45.9% (8.7M → 4.7M), API calls down 33.6%.

Install

curl -fsSL https://raw.githubusercontent.com/okyashgajjar/costaffective-mcp/main/install.sh | bash

Or manual: CGO_ENABLED=1 go build -o costaffective ./cmd/costaffective/

Server config for any MCP client:

{
  "mcpServers": {
    "costaffective": {
      "command": "costaffective",
      "args": ["serve"]
    }
  }
}

Supports Claude Code, Cursor, OpenCode, Cline, Codex CLI, Antigravity, and any stdio MCP client.

Requirements

Go 1.25+, C compiler (CGO required for go-sqlite3 and tree-sitter). Linux amd64/arm64, macOS amd64/arm64, Windows amd64.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"